package com.ruoyi.ss.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.ss.mapper.SsUserMapper;
import com.ruoyi.ss.domain.SsUser;
import com.ruoyi.ss.service.ISsUserService;

/**
 * 小程序用户Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-08-04
 */
@Service
public class SsUserServiceImpl implements ISsUserService 
{
    @Autowired
    private SsUserMapper ssUserMapper;

    /**
     * 查询小程序用户
     * 
     * @param userId 小程序用户主键
     * @return 小程序用户
     */
    @Override
    public SsUser selectSsUserByUserId(Long userId)
    {
        return ssUserMapper.selectSsUserByUserId(userId);
    }

    /**
     * 查询小程序用户列表
     * 
     * @param ssUser 小程序用户
     * @return 小程序用户
     */
    @Override
    public List<SsUser> selectSsUserList(SsUser ssUser)
    {
        return ssUserMapper.selectSsUserList(ssUser);
    }

    /**
     * 新增小程序用户
     * 
     * @param ssUser 小程序用户
     * @return 结果
     */
    @Override
    public int insertSsUser(SsUser ssUser)
    {
        ssUser.setCreateTime(DateUtils.getNowDate());
        return ssUserMapper.insertSsUser(ssUser);
    }

    /**
     * 修改小程序用户
     * 
     * @param ssUser 小程序用户
     * @return 结果
     */
    @Override
    public int updateSsUser(SsUser ssUser)
    {
        ssUser.setUpdateTime(DateUtils.getNowDate());
        return ssUserMapper.updateSsUser(ssUser);
    }

    /**
     * 批量删除小程序用户
     * 
     * @param userIds 需要删除的小程序用户主键
     * @return 结果
     */
    @Override
    public int deleteSsUserByUserIds(Long[] userIds)
    {
        return ssUserMapper.deleteSsUserByUserIds(userIds);
    }

    /**
     * 删除小程序用户信息
     * 
     * @param userId 小程序用户主键
     * @return 结果
     */
    @Override
    public int deleteSsUserByUserId(Long userId)
    {
        return ssUserMapper.deleteSsUserByUserId(userId);
    }
}
